package kr.couponplay.android.activity.deal.list;

import kr.couponplay.android.domain.deal.DealListResult;

public class DealListFragmentFactory {
	private DealListResult dealListBox;
	
	public DealListFragmentFactory(DealListResult dealListBox) {
		this.dealListBox = dealListBox;
	}
	
	public DealListFragment get(int position) {
		if (position == 0) {
			return CategoryDealListFragment.newInstance(dealListBox.getCategoryDeals());
		} else if (position == 1) {
			return NewDealListFragment.newInstance(dealListBox.getNewDeals());
		} else if (position == 2) {
			return EndDealListFragment.newInstance(dealListBox.getEndDeals());
		} else {
			return FreeDealListFragment.newInstance(dealListBox.getFreeDeals());
		}
	}
	
	public int getCount() {
		return 4;
	}
}
